/**
 * @see https://umijs.org/docs/max/access#access
 * */
export default function access(
  initialState: { userInfo?: UserTypes.UserInfo } | undefined,
) {
  const { userInfo } = initialState ?? {};
  return {
    canAdmin: userInfo && userInfo.access === 'admin',
  };
}
